import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { HrOfficialApplyVO, HrOfficialApplyForm, HrOfficialApplyQuery } from '@/api/general/humanresources/mobility/onboard/types';

/**
 * 查询员工转正申请审批列表
 * @param query
 * @returns {*}
 */

export const listHrOfficialApply = (query?: HrOfficialApplyQuery): AxiosPromise<HrOfficialApplyVO[]> => {
  return request({
    url: '/humanresource/hrOfficialApply/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询员工转正申请审批详细
 * @param id
 */
export const getHrOfficialApply = (id: string | number): AxiosPromise<HrOfficialApplyVO> => {
  return request({
    url: '/humanresource/hrOfficialApply/' + id,
    method: 'get'
  });
};

/**
 * 新增员工转正申请审批
 * @param data
 */
export const addHrOfficialApply = (data: HrOfficialApplyForm) => {
  return request({
    url: '/humanresource/hrOfficialApply',
    method: 'post',
    data: data
  });
};

/**
 * 修改员工转正申请审批
 * @param data
 */
export const updateHrOfficialApply = (data: HrOfficialApplyForm) => {
  return request({
    url: '/humanresource/hrOfficialApply',
    method: 'put',
    data: data
  });
};

/**
 * 删除员工转正申请审批
 * @param id
 */
export const delHrOfficialApply = (id: string | number | Array<string | number>) => {
  return request({
    url: '/humanresource/hrOfficialApply/' + id,
    method: 'delete'
  });
};
